//
//  qiyepeixunTableViewCell.m
//  PASystem
//
//  Created by michael on 16/8/9.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "qiyepeixunTableViewCell.h"

@implementation qiyepeixunTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
          self.selectionStyle = UITableViewCellSelectionStyleNone;
       self.selectionStyle = UITableViewCellSelectionStyleNone;
    
     _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
      [_label1 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
      [_label2 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label2];
    
       _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
      [_label3 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label3];
    
       _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
      [_label4 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label4];
    
       _label5 = [[UILabel alloc]init];
    _label5.frame = CGRectZero;
      [_label5 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label5];
    
       _label6 = [[UILabel alloc]init];
    _label6.frame = CGRectZero;
      [_label6 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label6];
    
       _label7 = [[UILabel alloc]init];
    _label7.frame = CGRectZero;
      [_label7 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label7];
    
       _label8 = [[UILabel alloc]init];
    _label8.frame = CGRectZero;
      [_label8 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label8];
    
}

return self;

}
- (void)layoutSubviews{
[super layoutSubviews];
float itemwidth = self.contentView.width/2;
float itemheight = self.contentView.height/2;


_label1.frame =CGRectMake(0, 0, itemwidth*.5, itemheight);

_label2.frame =CGRectMake(_label1.right, 0, itemwidth*.5, itemheight);
_label3.frame =CGRectMake(_label2.right, 0, itemwidth*.5, itemheight);
_label4.frame =CGRectMake(_label3.right, 0, itemwidth*.5, itemheight);
_label5.frame =CGRectMake(0,itemheight , itemwidth*.5, itemheight);
_label6.frame =CGRectMake(_label5.right,itemheight , itemwidth*.5, itemheight);
_label7.frame =CGRectMake(_label6.right,itemheight , itemwidth*.5, itemheight);
_label8.frame =CGRectMake(_label7.right,itemheight , itemwidth*.5, itemheight);


if ([_action isEqualToString:@"qypxList"]) {
_label1.text = @" 培训主题 :";
_label3.text = @" 培训老师 :";
_label5.text = @" 培训地址 :";
_label7.text = @" 培训时间 :";
_label2.text = _dict[@"TRAINNAME"];
_label4.text = _dict[@"TRAINTEACHER"];
_label6.text = _dict[@"TRAINADDRESS"];
NSString *string = _dict[@"TRAINTIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
_label8.text = selfYear;
}
else if([_action isEqualToString:@"jmqtList"]){
_label1.text = @" 经贸洽谈主题:";
_label3.text = @" 涉及行业 :";
_label5.text = @" 洽谈地址 :";
_label7.text = @" 洽谈时间 :";
_label2.text = _dict[@"NAME"];
_label4.text = _dict[@"TALKCONTENT"];
NSString *string = _dict[@"TALKTIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
_label6.text = _dict[@"TALKADD"];
_label8.text = selfYear;


}
else if([_action isEqualToString:@"gfkcList"]){
 _label1.text = @" 培训主题 :";
_label3.text = @" 培训领导 :";
_label5.text = @" 培训地址 :";
_label7.text = @" 培训时间 :";
_label2.text = _dict[@"NAME"];
_label4.text = _dict[@"LEADER"];
_label6.text = _dict[@"INVESTADD"];
NSString *string = _dict[@"INVESTTIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
_label8.text = selfYear;



}
else if([_action isEqualToString:@"hyjlList"]){
 _label1.text = @" 会议交流主题:";
//_label3.text = @" 培训领导 :";
_label5.text = @" 交流地址 :";
_label7.text = @" 培训时间 :";
_label2.text = _dict[@"NAME"];
//_label4.text = _dict[@"LEADER"];
_label6.text = _dict[@"COMMUNICATEADD"];
NSString *string = _dict[@"COMMUNICATETIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
_label8.text = selfYear;



}
else if([_action isEqualToString:@"qykcList"]){
 _label1.text = @" 考察主题:";
//_label3.text = @" 培训领导 :";
_label5.text = @" 考察地址 :";
_label7.text = @" 考察时间 :";
_label2.text = _dict[@"NAME"];
//_label4.text = _dict[@"LEADER"];
_label6.text = _dict[@"INVESTADD"];
NSString *string = _dict[@"INVESTTIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
_label8.text = selfYear;



}




}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
